#ifndef IMAGEVIEW_H
#define IMAGEVIEW_H

#include "abstractview.h"

class QTreeWidgetItem;
namespace Jcr
{
class ImageViewPrivate;
class ImageView : public AbstractView
{
    Q_OBJECT
public:
    explicit ImageView(QWidget* parent = nullptr);
    ~ImageView();

    void setRootPath(const QString& root);
    QString rootPath() const;

public slots:
    void reload();

protected:
    void init();
    virtual void contextMenuEvent(QContextMenuEvent* e);

private slots:
    void onItemDoubleClicked(QTreeWidgetItem* item, int column);

private:
    void readFolder(QTreeWidgetItem* parentItem, const QString& folder);
    void createContextMenu();

private:
    Q_DISABLE_COPY(ImageView)
    ImageViewPrivate* d_ptr;
};

}
#endif // IMAGEVIEW_H
